Component({
  data: {
    showPopup: false,
    popupIn: false,
    stats: [
      { label: '星币', value: 0 },
      { label: '电子金币', value: 0 },
      { label: '星票', value: 0 },
      { label: '优惠券', value: 1 },
      { label: '星星票', value: 0 },
      { label: '娃娃点', value: 0 },
    ]
  },
  methods: {
    openPopup() {
      this.setData({ showPopup: true });
      setTimeout(() => {
        this.setData({ popupIn: true });
      }, 30);
    },
    closePopup() {
      this.setData({ popupIn: false });
      setTimeout(() => {
        this.setData({ showPopup: false });
      }, 300);
    },
    goTo(e) {
      wx.navigateTo({
        url: `/pages/index/more/more?currentTab=${1}`,
        fail: (err) => {
          console.error("跳转失败:", err);
          wx.showToast({
            title: '跳转失败',
            icon: 'none'
          });
        }
      });
    }
  }
})
